Skip to content

Switch to the LLVM SPIR-V back-end. #491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Feb 13, 2025

PoC, requires quite some work

  • exp intrinsic is broken
    PHI node operands are not the same type as the result!
      %common.ret.op = phi [2 x float] [ %177, %L5 ], [ %192, %L28 ], [ %201, %L41 ], [ %213, %L53 ], [ %4, %L25 ], [ %8, %L19 ]
    Function return type does not match operand type of return inst!
      ret [2 x float] %common.ret.op
     i32in function julia_exp_27849
    
  • atomics probably have to be ported to native LLVM atomics
  • the lack of OpCapability Linkage results in ZE_RESULT_ERROR_INVALID_MODULE_UNLINKED (I think)

@maleadt
Copy link
Member Author

maleadt commented Feb 13, 2025

the lack of OpCapability Linkage results in ZE_RESULT_ERROR_INVALID_MODULE_UNLINKED (I think)

The actual issue is our use of OpenCL intrinsic functions to access things like the work dimension. We'll have to implement get_work_dim as an access to @__spirv_BuiltInWorkDim = external addrspace(1) global i32 instead of call to _Z12get_work_dim.

@maleadt maleadt force-pushed the tb/llvm_spirv_backend branch from 1d1f809 to 805799c Compare July 10, 2025 07:29
@maleadt
Copy link
Member Author

maleadt commented Jul 10, 2025

Rebased. Things work, however, this triggers multiple crashes in the Intel compiler stack. Anybody who would want to look into this would need to (first upgrade the compiler stack, but if things persist then) reduce the issues to minimal issues and file them upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant